<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    function formData(times, formot) {
        times = new Date();
        var obj = {
            yyyy: times.getFullYear(),
            yy: ("" + times.getFullYear()).slice(-2),
            M: times.getMonth() + 1,
            MM: ("0" + (times.getMonth() + 1)).slice(-2),
            d: times.getDate(),
            dd: ("0" + times.getDate()).slice(-2),
            H: times.getHours(),
            HH: ("0" + times.getHours()).slice(-2),
            h: times.getHours() % 12,
            hh: ("0" + times.getHours() % 12).slice(-2),
            m: times.getMinutes(),
            mm: ("0" + times.getMinutes()).slice(-2),
            s: times.getSeconds(),
            ss: ("0" + times.getSeconds()).slice(-2),
            w: ['日', '一', '二', '三', '四', '五', '六'][times.getDay()]
        }
        return formot.replace(/([a-z]+)/ig, function ($1) {
            return obj[$1]
        })
    }
    console.log(formData(1409894060000, 'yyyy - MM - dd HH: mm: ss星期w'))
</script>